package com.tangula.web.config.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.tangula.web.config.web.interceptor.CorsInterceptor;
import com.tangula.web.config.web.interceptor.KashineInterceptor;

/**
 * 配置SpringMvc.
 * @author 王东石 &lt;wangds2016@163.com&gt;
 *
 */
@EnableWebMvc
public class WebConfigure implements WebMvcConfigurer {
	
	@Autowired
	protected CorsInterceptor corsInterceptor;
	@Autowired
	protected KashineInterceptor kashineInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		WebMvcConfigurer.super.addInterceptors(registry);
		
		registry.addInterceptor(corsInterceptor);
		registry.addInterceptor(kashineInterceptor);
		
	}
	
}
